﻿Imports Microsoft.Reporting.WinForms

'Page de test
Public Class UserControl1
    Private Sub UserControl1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Instanciation du rapport local
        Dim localReport As LocalReport
        localReport = ReportViewer1.LocalReport
        'Création des paramètres
        Dim entete As New ReportParameter()
        entete.Name = "Entete"
        entete.Values.Add("Du 2012-11-01 au 2012-11-01")
        Dim util As New ReportParameter()
        util.Name = "NomUtil"
        util.Values.Add("moi")

        'requête HeurePlage
        'Dim liste As New List(Of HeureTravaille)
        'Dim test As New HeureTravaille(120, "2012-11-18", "cuisine")
        'liste.Add(test)
        'test = New HeureTravaille(120, "2012-11-19", "atelier")
        'liste.Add(test)
        'test = New HeureTravaille(120, "2012-11-20", "cuisine")
        'liste.Add(test)
        'test = New HeureTravaille(120, "2012-11-21", "cuisine")
        'liste.Add(test)
        'test = New HeureTravaille(120, "2012-11-22", "musique")
        'liste.Add(test)
        'test = New HeureTravaille(240, "2012-11-23", "jardinage")
        'liste.Add(test)
        'test = New HeureTravaille(720, "2012-11-24", "cuisine")
        'liste.Add(test)
        'HeureTravailleBindingSource.DataSource = liste

        'Requête HeureTravail
        'Dim liste As New List(Of HeureTravaille)
        'Dim test As New HeureTravaille(1, "joe", "2012-11-18", 120)
        'liste.Add(test)
        'test = New HeureTravaille(2, "Tom", "2012-11-19", 120)
        'liste.Add(test)
        'test = New HeureTravaille(1, "joe", "2012-11-20", 240)
        'liste.Add(test)
        'test = New HeureTravaille(2, "Tom", "2012-11-21", 180)
        'liste.Add(test)
        'test = New HeureTravaille(3, "Guy", "2012-11-22", 120)
        'liste.Add(test)
        'test = New HeureTravaille(3, "Guy", "2012-11-23", 240)
        'liste.Add(test)
        'test = New HeureTravaille(4, "Simon", "2012-11-24", 720)
        'liste.Add(test)
        'HeureTravailleBindingSource.DataSource = liste

        'Requête EmpPlage
        'Dim liste As New List(Of HeureTravaille)
        'Dim test As New HeureTravaille(1, "joe Karignant", "2012-11-18", 120, "cuisine")
        'liste.Add(test)
        'test = New HeureTravaille(2, "Tom Jones", "2012-11-19", 120, "atelier")
        'liste.Add(test)
        'test = New HeureTravaille(1, "joe Karignant", "2012-11-20", 240, "cuisine")
        'liste.Add(test)
        'test = New HeureTravaille(2, "Tom Jones", "2012-11-21", 180, "cuisine")
        'liste.Add(test)
        'test = New HeureTravaille(3, "Guy Beland", "2012-11-22", 120, "musique")
        'liste.Add(test)
        'test = New HeureTravaille(3, "Guy Beland", "2012-11-23", 240, "jardinage")
        'liste.Add(test)
        'test = New HeureTravaille(4, "Simon Pellerin", "2012-11-24", 720, "cuisine")
        'liste.Add(test)
        'HeureTravailleBindingSource.DataSource = liste

        'Dim liste As New List(Of DAL.Employe)
        'EmployeBindingSource.DataSource = (From x In bd.Employes Select x).ToList()

        'Dim liste As New List(Of Employes)
        'Dim test As New Employes(1, "Jean-Guy", Today, "123 street", "quebec", "J1J 1J1", Today, 0)
        'liste.Add(test)
        'test = New Employes(2, "Jean-Paul", Today, "124 street", "quebec", "J1J 1J1", Today, 1, "kungfu")
        'liste.Add(test)
        'test = New Employes(3, "Jean-Pierre", Today, "125 street", "quebec", "J1J 1J1", Today, 2, "saint-clerc", "philosophie")
        'liste.Add(test)
        'test = New Employes(4, "Janne", Today, "126 street", "quebec", "J1J 1J1", Today, 2, "saint-george", "informatique")
        'liste.Add(test)
        'test = New Employes(5, "Joanne", Today, "127 street", "quebec", "J1J 1J2", Today, 0)
        'liste.Add(test)
        'EmployesBindingSource.DataSource = liste

        'Insertion des paramètres au rapport
        Dim parameters() As ReportParameter = {entete, util}
        localReport.SetParameters(parameters)

        'Redémarrer le rapport
        ReportViewer1.RefreshReport()
    End Sub
End Class
